/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package proyectoprogracuestionario;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.JFrame;
import javax.swing.*;
import javax.swing.border.TitledBorder;
/**
 *
 * @author D E L L
 */
public class TextoArea extends JPanel {
    private JPanel pnlPreguntaCmb,pnlPregunta,pnl11,pnlPreguntaE,pnlSolu,pnlOK,pnl13;
    private JTextField txtTituloP,txtayuda,txtSE;
    private JLabel lblTituP,lblTextAyu,lblSolu,lblEliminar;
    private JButton btnAgregar,btnModificar,btnAceptar,btnEviarP,btnCancelaP;
    private JTextArea txtSoluc,txtmodif;
    private JScrollPane contenedor = new JScrollPane();
    private JLabel lbltitulo,lbltextoayuda;
    private JScrollPane scraux;
    private String respuesta;
    DefaultListModel solucion = new DefaultListModel();
    
    public TextoArea(){
        this.setSize(720, 600);
        this.add(pnlPreguntaCmb= new JPanel());
        pnlPreguntaCmb.setBorder(new TitledBorder("Pregunta tipo texto extendido"));
        pnlPreguntaCmb.setLayout(new BoxLayout(pnlPreguntaCmb,BoxLayout.Y_AXIS ));
        
        JPanel pnl0, pnl1,pnl2,pnl12;
        pnlPreguntaCmb.add(pnlPregunta= new JPanel());
        pnlPregunta.add(pnl0= new JPanel());        
        pnl0.setLayout(new BoxLayout(pnl0, BoxLayout.Y_AXIS));
       // pnlPregunta.add(pnl1= new JPanel());
        pnl0.add(lbltitulo= new JLabel());
        lbltitulo.setVisible(false);
        pnl0.add(lblTituP= new JLabel("Titulo de la Pregunta"));
        pnl0.add(txtTituloP= new JTextField(50));
        //pnlPregunta.add(pnl2= new JPanel());
        pnl0.add(lbltextoayuda= new JLabel());
        lbltextoayuda.setVisible(false);
        pnl0.add(lblTextAyu= new JLabel(" Texto de Ayuda        "));
        pnl0.add(txtayuda= new JTextField(49));
       
        pnlPreguntaCmb.add(pnlSolu= new JPanel());
        pnlSolu.add(pnl11= new JPanel());
        pnl11.setLayout(new BoxLayout(pnl11, BoxLayout.Y_AXIS));
        pnl11.add(pnl12= new JPanel());
        pnl12.setLayout(new BorderLayout());
        pnl12.add(txtSoluc= new JTextArea(5,40));
       // txtArea = new JTextArea(5,40);
        //txtArea.setEditable(false);        
        //txtArea.setText("\n\nSu respuesta más extensa");
        contenedor.setViewportView(txtSoluc);
        pnl12.add(contenedor,BorderLayout.CENTER);
        
       
    }

   public void vistaTA(){
         lbltitulo.setText(txtTituloP.getText());
         lbltitulo.setVisible(true);
         lblTituP.setVisible(false);
         txtTituloP.setVisible(false);
         lbltextoayuda.setText(txtayuda.getText());
         lbltextoayuda.setVisible(true);
         lblTextAyu.setVisible(false);
         txtayuda.setVisible(false);
         respuesta = txtSoluc.getText();
         txtSoluc.setText("");
         
            
        }
}
